﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminSite.Master" AutoEventWireup="true" CodeBehind="WaitingStockOrders.aspx.cs" Inherits="Agents.Admin.WaitingStockOrders" %>
<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit"%>
<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server" />
    <h1>
        צפיה בהזמנות מלאי ממתינות
    </h1>            
    <hr />       

    <asp:DataGrid runat="server" ID="dgStockOrders" AutoGenerateColumns="False"
        AllowPaging="True" PageSize="12" PagerStyle-Mode="NumericPages" 
        DataSourceID="SqlDataSource1" BackColor="White" BorderStyle="None" 
        CellPadding="3" GridLines="Both"
        onpageindexchanged="dgStockOrders_PageIndexChanged"
        OnItemCommand="dgStockOrders_ItemCommand" CssClass="dataGrid" 
        Font-Names="Verdana" BorderColor="#999999" BorderWidth="1px">
        <AlternatingItemStyle BackColor="#DCDCDC" />
        <Columns>
            <asp:BoundColumn DataField="Id" HeaderText="מספר הזמנה" />
            <asp:BoundColumn DataField="Date" HeaderText="תאריך הזמנה" />
            <asp:BoundColumn DataField="Sum" HeaderText="סכום" />
            <asp:TemplateColumn>
                <ItemTemplate>
                    <asp:LinkButton ID="lnkOrderDetails" runat="server" Text="פרטי הזמנה" CommandName="ShowOrderDetails"/>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn>
                <ItemTemplate>
                    <asp:LinkButton ID="TemplateButton" runat="server" Text="בטל הזמנה" CommandName="CancelOrder"/>
                    <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server"
                        TargetControlID="TemplateButton" DisplayModalPopupID="modalPopUp" />
                    <asp:Panel ID="popup" runat="server" CssClass="popup">
                        <table>
                            <tr><td colspan="2">האם אתה בטוח שברצונך למחוק את ההזמנה?</td></tr>
                            <tr>
                                <td><asp:Button ID="ok" Text="כן" runat="server" CssClass="button" /></td>
                                <td><asp:Button ID="cancel" Text="לא" runat="server" CssClass="button" /></td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <ajaxToolkit:ModalPopupExtender ID="modalPopUp" CancelControlID="cancel" PopupControlID="popup"
                        OkControlID="ok" runat="server" TargetControlID="TemplateButton" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn>
                <ItemTemplate>
                    <asp:LinkButton ID="lnkOrderArrived" runat="server" Text="הזמנה הגיעה" CommandName="OrderArrived"/>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <ItemStyle BackColor="White" ForeColor="Black" />
        <PagerStyle Mode="NumericPages" BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
        <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    </asp:DataGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AgentConnectionString %>" 
        SelectCommand="SELECT [Id], [Date], [Sum] FROM [StockOrders] WHERE [IsPending] = 1 ORDER BY Id ASC">
    </asp:SqlDataSource>
                       
    <br />           
    <hr />
    <div class="alignCenter">               
        <asp:Button ID="backBtn" Text="חזור" runat="server" onclick="backBtn_Click" CssClass="button" />
    </div>
</asp:Content>
